stage.set_background("underwater")
score = 0
score_board = codesters.Display(score)
weak_pws = ["password", "password123", "hello1", "snuffles", "123456"]
strong_pws = ["GgbvTa581!@", "@Mjrc0olguy!", "007jmSB0nd!", "108turt!es762", "Avv3SoMe!305"]
t = codesters.Teacher()
try:
tval1 = t.find_text('all_pws')[0][1].replace(' ', '')
except:
tval1 = "DNE"
#print tval1
t1 = TestObjective()
t1.add_success('strong_pws+weak_pws' in tval1 or 'weak_pws+strong_pws' in tval1, "Great job!")
t1.add_failure(tval1 == "DNE", "Did you use an Add List command to combine weak_pws with strong_pws?")
t1.add_failure('weak_pws' not in tval1, "Did you change the first list name in your Add List command to weak_pws?")
t1.add_failure('strong_pws' not in tval1, "Did you change the second list name in your Add LIst command to strong_pws?")
t1.add_failure('[strong_pws]' in tval1 or '[weak_pws]' in tval1, "Make sure to delete the square brackets.")
t1.add_failure('strong_pws+weak_pws' not in tval1 and 'weak_pws+strong_pws' not in tval1, "Make sure you use an Add List command to combine your two lists!")
tester = TestManager()
tester.add_test_list([t1])
tester.run_tests()
tester.display_first_feedback()
-
Run Code
-
Activity Submitted!
Submit Work
-
Next Activity
-
Stop Running Code
-
Show Chart
-
Show Console
-
Reset Code Editor
-
Codesters How To (opens in a new tab)